<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
   <meta name="description" content="command line parsing">
    
    <meta name="author" content="John S. Urban" >
    <link rel="icon" href="../favicon.png">

    <title>set_args &ndash; M_CLI2</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/pygments.css" rel="stylesheet">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/local.css" rel="stylesheet">
    
    <link  href="../tipuesearch/tipuesearch.css" rel="stylesheet">
    
    

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script src="../js/jquery-2.1.3.min.js"></script>
    <script src="../js/svg-pan-zoom.min.js"></script>

  </head>

  <body>

    <!-- Fixed navbar -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="../index.html">M_CLI2 </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
        
            <li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
              <a href="#" class="dropdown-toggle"
              data-toggle="dropdown" role="button"
              aria-haspopup="true"
     aria-expanded="false">Contents <span class="caret"></span></a>
        <ul class="dropdown-menu">
          
              
            <li><a href="../lists/files.html">Source Files</a></li>
        
        
        
            <li><a href="../lists/modules.html">Modules</a></li>
        
            
                                
            <li><a href="../lists/procedures.html">Procedures</a></li>
        
               
            <li><a href="../lists/types.html">Derived Types</a></li>
        
        
            <li><a href="../lists/programs.html">Programs</a></li>
        
            </ul>
            </li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/files.html">Source Files</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/modules.html">Modules</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/procedures.html">Procedures</a></li>

                             
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/types.html">Derived Types</a></li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/programs.html">Programs</a></li>

          </ul>
        
        <form action="../search.html" class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
        </div>
<!--
        <button type="submit" class="btn btn-default">Submit</button>
-->
        </form>
        
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container">
    
  
  <div class="row">
    <h1>set_args
      <small>Subroutine</small>
    
    </h1>
    
<div class="row">
  <div class="col-lg-12">
<div class="well well-sm">
  <ul class="list-inline" style="margin-bottom:0px;display:inline">
     
     
     
     
    
    
     <li><i class="fa fa-list-ol"></i>
       <a data-toggle="tooltip"
    data-placement="bottom" data-html="true"
    title="15.9% of total for procedures.">47 statements</a>
     </li> 
     
     
     
    <li><i class="fa fa-code"></i><a href="../src/M_CLI2.F90"> Source File</a></li>
     
     
  </ul>
  <ol class="breadcrumb in-well text-right">
  
    
     <li><a href='../sourcefile/m_cli2.f90.html'>M_CLI2.F90</a></li>
    
     <li><a href='../module/m_cli2.html'>M_CLI2</a></li>
    
  
     <li class="active">set_args</li>
  </ol>
</div>
</div>
</div>
<script>
  $(function () {
  $('[data-toggle="tooltip"]').tooltip()
  })
</script>

  </div>
  
  <div class="row">
    <div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
    
<div id="sidebar">
  
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-0">Variables</a></h3></div>
  <div id="vars-0" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../proc/set_args.html#variable-hold">hold</a>
      
      <a class="list-group-item" href="../proc/set_args.html#variable-ibig">ibig</a>
      
    </div>
  </div>
</div>




















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../proc/set_args.html#src">set_args</a>
  </div>
</div>



</div>

    </div>
    
    <div class="col-md-9" id='text'>
    <h2>
public subroutine set_args(prototype, help_text, version_text, string, ierr, errmsg)
    
    
   
</h2>
    
  


    
    <h2 id="name">NAME</h2>
<div class="codehilite"><pre><span></span><code> set_args(3f) - [ARGUMENTS:M_CLI2] command line argument parsing
 (LICENSE:PD)
</code></pre></div>

<h2 id="synopsis">SYNOPSIS</h2>
<div class="codehilite"><pre><span></span><code> subroutine set_args(definition,help_text,version_text,ierr,errmsg)

  character(len=*),intent(in),optional              :: definition
  character(len=*),intent(in),optional              :: help_text(:)
  character(len=*),intent(in),optional              :: version_text(:)
  integer,intent(out),optional                      :: ierr
  character(len=:),intent(out),allocatable,optional :: errmsg
</code></pre></div>

<h2 id="description">DESCRIPTION</h2>
<div class="codehilite"><pre><span></span><code> <span class="nv">SET_ARGS</span><span class="ss">(</span><span class="mi">3</span><span class="nv">f</span><span class="ss">)</span> <span class="nv">requires</span> <span class="nv">a</span> <span class="mi">1</span><span class="o">-</span><span class="nv">like</span> <span class="nv">command</span> <span class="nv">prototype</span> <span class="k">for</span> <span class="nv">defining</span>
 <span class="nv">arguments</span> <span class="nv">and</span> <span class="nv">default</span> <span class="nv">command</span><span class="o">-</span><span class="nv">line</span> <span class="nv">options</span>. <span class="nv">Argument</span> <span class="nv">values</span> <span class="nv">are</span> <span class="k">then</span>
 <span class="nv">read</span> <span class="nv">using</span> <span class="nv">GET_ARGS</span><span class="ss">(</span><span class="mi">3</span><span class="nv">f</span><span class="ss">)</span>.

 <span class="nv">The</span> <span class="o">--</span><span class="nv">help</span> <span class="nv">and</span> <span class="o">--</span><span class="nv">version</span> <span class="nv">options</span> <span class="nv">require</span> <span class="nv">the</span> <span class="nv">optional</span>
 <span class="nv">help_text</span> <span class="nv">and</span> <span class="nv">version_text</span> <span class="nv">values</span> <span class="nv">to</span> <span class="nv">be</span> <span class="nv">provided</span>.
</code></pre></div>

<h2 id="options">OPTIONS</h2>
<div class="codehilite"><pre><span></span><code><span class="nv">DEFINITION</span>  <span class="nv">composed</span> <span class="nv">of</span> <span class="nv">all</span> <span class="nv">command</span> <span class="nv">arguments</span> <span class="nv">concatenated</span>
            <span class="nv">into</span> <span class="nv">a</span> <span class="nv">Unix</span><span class="o">-</span><span class="nv">like</span> <span class="nv">command</span> <span class="nv">prototype</span> <span class="nv">string</span>. <span class="k">For</span>
            <span class="nv">example</span>:

             <span class="k">call</span> <span class="nl">set_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">-L F -ints 10,20,30 -title &quot;my title&quot; -R 10.3</span><span class="s1">&#39;</span><span class="ss">)</span>

            <span class="nv">DEFINITION</span> <span class="nv">is</span> <span class="nv">pre</span><span class="o">-</span><span class="nv">defined</span> <span class="nv">to</span> <span class="nv">act</span> <span class="nv">as</span> <span class="k">if</span> <span class="nv">started</span> <span class="nv">with</span>
            <span class="nv">the</span> <span class="nv">reserved</span> <span class="nv">options</span> <span class="s1">&#39;</span><span class="s">--verbose F --usage F --help</span>
            <span class="nv">F</span> <span class="o">--</span><span class="nv">version</span> <span class="nv">F</span><span class="s1">&#39;</span><span class="s">. The --usage option is processed when</span>
            <span class="nv">the</span> <span class="nv">set_args</span><span class="ss">(</span><span class="mi">3</span><span class="nv">f</span><span class="ss">)</span> <span class="nv">routine</span> <span class="nv">is</span> <span class="nv">called</span>. <span class="nv">The</span> <span class="nv">same</span> <span class="nv">is</span> <span class="nv">true</span>
            <span class="k">for</span> <span class="o">--</span><span class="nv">help</span> <span class="nv">and</span> <span class="o">--</span><span class="nv">version</span> <span class="k">if</span> <span class="nv">the</span> <span class="nv">optional</span> <span class="nv">help_text</span>
            <span class="nv">and</span> <span class="nv">version_text</span> <span class="nv">options</span> <span class="nv">are</span> <span class="nv">provided</span>.

            <span class="nv">see</span> <span class="s2">&quot;</span><span class="s">DEFINING THE PROTOTYPE</span><span class="s2">&quot;</span> <span class="nv">in</span> <span class="nv">the</span> <span class="k">next</span> <span class="nv">section</span> <span class="k">for</span>
            <span class="nv">further</span> <span class="nv">details</span>.

<span class="nv">HELP_TEXT</span>   <span class="k">if</span> <span class="nv">present</span>, <span class="nv">will</span> <span class="nv">be</span> <span class="nv">displayed</span> <span class="k">if</span> <span class="nv">program</span> <span class="nv">is</span> <span class="nv">called</span> <span class="nv">with</span>
            <span class="o">--</span><span class="nv">help</span> <span class="nv">switch</span>, <span class="nv">and</span> <span class="k">then</span> <span class="nv">the</span> <span class="nv">program</span> <span class="nv">will</span> <span class="nv">terminate</span>. <span class="k">If</span>
            <span class="nv">not</span> <span class="nv">supplied</span>, <span class="nv">the</span> <span class="nv">command</span> <span class="nv">line</span> <span class="nv">initialization</span> <span class="nv">string</span>
            <span class="nv">will</span> <span class="nv">be</span> <span class="nv">shown</span> <span class="nv">when</span> <span class="o">--</span><span class="nv">help</span> <span class="nv">is</span> <span class="nv">used</span> <span class="nv">on</span> <span class="nv">the</span> <span class="nv">commandline</span>.

  <span class="nv">VERSION_TEXT</span>  <span class="k">if</span> <span class="nv">present</span>, <span class="nv">will</span> <span class="nv">be</span> <span class="nv">displayed</span> <span class="k">if</span> <span class="nv">program</span> <span class="nv">is</span> <span class="nv">called</span> <span class="nv">with</span>
                <span class="o">--</span><span class="nv">version</span> <span class="nv">switch</span>, <span class="nv">and</span> <span class="k">then</span> <span class="nv">the</span> <span class="nv">program</span> <span class="nv">will</span> <span class="nv">terminate</span>.
  <span class="nv">IERR</span>          <span class="k">if</span> <span class="nv">present</span> <span class="nv">a</span> <span class="nv">non</span><span class="o">-</span><span class="nv">zero</span> <span class="nv">option</span> <span class="nv">is</span> <span class="nv">returned</span> <span class="nv">when</span> <span class="nv">an</span>
                <span class="nv">error</span> <span class="nv">occurs</span> <span class="nv">instead</span> <span class="nv">of</span> <span class="nv">program</span> <span class="nv">execution</span> <span class="nv">being</span>
                <span class="nv">terminated</span>
  <span class="nv">ERRMSG</span>        <span class="nv">a</span> <span class="nv">description</span> <span class="nv">of</span> <span class="nv">the</span> <span class="nv">error</span> <span class="k">if</span> <span class="nv">ierr</span> <span class="nv">is</span> <span class="nv">present</span>
</code></pre></div>

<h2 id="defining-the-prototype">DEFINING THE PROTOTYPE</h2>
<div class="codehilite"><pre><span></span><code>     <span class="n">o</span> <span class="n">all</span> <span class="n">keywords</span> <span class="n">on</span> <span class="n">the</span> <span class="n">prototype</span> <span class="n">MUST</span> <span class="n">get</span> <span class="n">a</span> <span class="n">value</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">logicals</span> <span class="n">MUST</span> <span class="n">be</span> <span class="n">set</span> <span class="n">to</span> <span class="n">F</span> <span class="ow">or</span> <span class="n">T</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">strings</span> <span class="n">MUST</span> <span class="n">be</span> <span class="n">delimited</span> <span class="n">with</span> <span class="n">double</span><span class="o">-</span><span class="n">quotes</span> <span class="ow">and</span>
       <span class="n">must</span> <span class="n">be</span> <span class="n">at</span> <span class="n">least</span> <span class="n">one</span> <span class="n">space</span><span class="o">.</span> <span class="n">Internal</span> <span class="n">double</span><span class="o">-</span><span class="n">quotes</span>
       <span class="n">are</span> <span class="n">represented</span> <span class="n">with</span> <span class="n">two</span> <span class="n">double</span><span class="o">-</span><span class="n">quotes</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">numeric</span> <span class="n">keywords</span> <span class="n">are</span> <span class="ow">not</span> <span class="n">allowed</span><span class="p">;</span> <span class="n">but</span> <span class="n">this</span> <span class="n">allows</span>
       <span class="n">negative</span> <span class="n">numbers</span> <span class="n">to</span> <span class="n">be</span> <span class="n">used</span> <span class="k">as</span> <span class="n">values</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">lists</span> <span class="n">of</span> <span class="n">values</span> <span class="n">should</span> <span class="n">be</span> <span class="n">comma</span><span class="o">-</span><span class="n">delimited</span> <span class="n">unless</span> <span class="n">a</span>
       <span class="n">user</span><span class="o">-</span><span class="n">specified</span> <span class="n">delimiter</span> <span class="k">is</span> <span class="n">used</span><span class="o">.</span> <span class="n">The</span> <span class="n">prototype</span>
       <span class="n">must</span> <span class="n">use</span> <span class="n">the</span> <span class="n">same</span> <span class="n">array</span> <span class="n">delimiters</span> <span class="k">as</span> <span class="n">the</span> <span class="n">call</span> <span class="n">to</span>
       <span class="n">the</span> <span class="n">family</span> <span class="n">of</span> <span class="n">get_args</span><span class="o">*</span><span class="p">(</span><span class="mi">3</span><span class="n">f</span><span class="p">)</span> <span class="n">called</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">long</span> <span class="n">names</span> <span class="p">(</span><span class="o">--</span><span class="n">keyword</span><span class="p">)</span> <span class="n">should</span> <span class="n">be</span> <span class="n">all</span> <span class="n">lowercase</span>

     <span class="n">o</span> <span class="n">The</span> <span class="n">simplest</span> <span class="n">way</span> <span class="n">to</span> <span class="n">have</span> <span class="n">short</span> <span class="n">names</span> <span class="k">is</span> <span class="n">to</span> <span class="n">suffix</span> <span class="n">the</span> <span class="n">long</span>
       <span class="n">name</span> <span class="n">with</span> <span class="p">:</span><span class="n">LETTER</span> <span class="n">If</span> <span class="n">this</span> <span class="n">syntax</span> <span class="k">is</span> <span class="n">used</span> <span class="n">then</span> <span class="n">logical</span> <span class="n">shorts</span>
       <span class="n">may</span> <span class="n">be</span> <span class="n">combined</span> <span class="n">on</span> <span class="n">the</span> <span class="n">command</span> <span class="n">line</span> <span class="ow">and</span> <span class="o">--</span> <span class="ow">and</span> <span class="o">-</span> <span class="n">prefixes</span> <span class="n">are</span>
       <span class="n">strictly</span> <span class="n">enforced</span><span class="o">.</span>

       <span class="n">mapping</span> <span class="n">of</span> <span class="n">short</span> <span class="n">names</span> <span class="n">to</span> <span class="n">long</span> <span class="n">names</span> <span class="ow">not</span> <span class="n">using</span> <span class="n">the</span>
       <span class="o">--</span><span class="n">LONGNAME</span><span class="p">:</span><span class="n">SHORTNAME</span> <span class="n">syntax</span> <span class="k">is</span> <span class="n">demonstrated</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">manpage</span>
       <span class="k">for</span> <span class="n">SPECIFIED</span><span class="p">(</span><span class="mi">3</span><span class="n">f</span><span class="p">)</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">A</span> <span class="n">very</span> <span class="n">special</span> <span class="n">behavior</span> <span class="n">occurs</span> <span class="k">if</span> <span class="n">the</span> <span class="n">keyword</span> <span class="n">name</span> <span class="n">ends</span> <span class="ow">in</span> <span class="p">::</span><span class="o">.</span>
       <span class="n">The</span> <span class="n">next</span> <span class="n">parameter</span> <span class="k">is</span> <span class="n">taken</span> <span class="k">as</span> <span class="n">a</span> <span class="n">value</span> <span class="n">even</span> <span class="k">if</span> <span class="n">it</span> <span class="n">starts</span> <span class="n">with</span> <span class="o">-.</span>
       <span class="n">This</span> <span class="k">is</span> <span class="ow">not</span> <span class="n">generally</span> <span class="n">recommended</span> <span class="n">but</span> <span class="k">is</span> <span class="n">noted</span> <span class="n">here</span> <span class="k">for</span>
       <span class="n">completeness</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">to</span> <span class="n">define</span> <span class="n">a</span> <span class="n">zero</span><span class="o">-</span><span class="n">length</span> <span class="n">allocatable</span> <span class="n">array</span> <span class="n">make</span> <span class="n">the</span>
       <span class="n">value</span> <span class="n">a</span> <span class="n">delimiter</span> <span class="p">(</span><span class="n">usually</span> <span class="n">a</span> <span class="n">comma</span><span class="p">)</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">all</span> <span class="n">unused</span> <span class="n">values</span> <span class="n">go</span> <span class="n">into</span> <span class="n">the</span> <span class="n">character</span> <span class="n">array</span> <span class="n">UNNAMED</span>

     <span class="n">o</span> <span class="n">If</span> <span class="n">the</span> <span class="n">prototype</span> <span class="n">ends</span> <span class="n">with</span> <span class="s2">&quot;--&quot;</span> <span class="n">a</span> <span class="n">special</span> <span class="n">mode</span> <span class="k">is</span> <span class="n">turned</span>
       <span class="n">on</span> <span class="n">where</span> <span class="n">anything</span> <span class="n">after</span> <span class="s2">&quot;--&quot;</span> <span class="n">on</span> <span class="n">input</span> <span class="n">goes</span> <span class="n">into</span> <span class="n">the</span> <span class="n">variable</span>
       <span class="n">REMAINING</span> <span class="ow">and</span> <span class="n">the</span> <span class="n">array</span> <span class="n">ARGS</span> <span class="n">instead</span> <span class="n">of</span> <span class="n">becoming</span> <span class="n">elements</span> <span class="ow">in</span>
       <span class="n">the</span> <span class="n">UNNAMED</span> <span class="n">array</span><span class="o">.</span> <span class="n">This</span> <span class="k">is</span> <span class="ow">not</span> <span class="n">needed</span> <span class="k">for</span> <span class="n">normal</span> <span class="n">processing</span><span class="o">.</span>
</code></pre></div>

<h2 id="usage">USAGE</h2>
<div class="codehilite"><pre><span></span><code>  <span class="n">When</span> <span class="n">invoking</span> <span class="n">the</span> <span class="n">program</span> <span class="n">line</span> <span class="n">note</span> <span class="n">that</span> <span class="p">(</span><span class="n">subject</span> <span class="n">to</span> <span class="n">change</span><span class="p">)</span> <span class="n">the</span>
  <span class="n">following</span> <span class="n">variations</span> <span class="n">from</span> <span class="n">other</span> <span class="n">common</span> <span class="n">command</span><span class="o">-</span><span class="n">line</span> <span class="n">parsers</span><span class="p">:</span>

     <span class="n">o</span> <span class="n">Long</span> <span class="n">names</span> <span class="n">should</span> <span class="n">be</span> <span class="n">all</span> <span class="n">lowercase</span> <span class="ow">and</span> <span class="n">always</span> <span class="n">more</span> <span class="n">than</span> <span class="n">one</span>
       <span class="n">character</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">values</span> <span class="k">for</span> <span class="n">duplicate</span> <span class="n">keywords</span> <span class="n">are</span> <span class="n">appended</span> <span class="n">together</span> <span class="n">with</span> <span class="n">a</span> <span class="n">space</span>
       <span class="n">separator</span> <span class="n">when</span> <span class="n">a</span> <span class="n">command</span> <span class="n">line</span> <span class="k">is</span> <span class="n">executed</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">numeric</span> <span class="n">keywords</span> <span class="n">are</span> <span class="ow">not</span> <span class="n">allowed</span><span class="p">;</span> <span class="n">but</span> <span class="n">this</span> <span class="n">allows</span>
       <span class="n">negative</span> <span class="n">numbers</span> <span class="n">to</span> <span class="n">be</span> <span class="n">used</span> <span class="k">as</span> <span class="n">values</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">Although</span> <span class="ow">not</span> <span class="n">generally</span> <span class="n">recommended</span> <span class="n">you</span> <span class="n">can</span> <span class="n">equivalence</span>
       <span class="n">keywords</span> <span class="p">(</span><span class="n">usually</span> <span class="k">for</span> <span class="n">multi</span><span class="o">-</span><span class="n">lingual</span> <span class="n">support</span><span class="p">)</span><span class="o">.</span> <span class="n">Be</span> <span class="n">aware</span> <span class="n">that</span>
       <span class="n">specifying</span> <span class="n">both</span> <span class="n">names</span> <span class="n">of</span> <span class="n">an</span> <span class="n">equivalenced</span> <span class="n">keyword</span> <span class="n">on</span> <span class="n">a</span> <span class="n">command</span>
       <span class="n">line</span> <span class="n">will</span> <span class="n">have</span> <span class="n">undefined</span> <span class="n">results</span> <span class="p">(</span><span class="n">currently</span><span class="p">,</span> <span class="n">their</span> <span class="n">ASCII</span>
       <span class="n">alphabetical</span> <span class="n">order</span> <span class="n">will</span> <span class="n">define</span> <span class="n">what</span> <span class="n">the</span> <span class="n">Fortran</span> <span class="n">variable</span>
       <span class="n">values</span> <span class="n">become</span><span class="p">)</span><span class="o">.</span>

       <span class="n">The</span> <span class="n">second</span> <span class="n">of</span> <span class="n">the</span> <span class="n">names</span> <span class="n">should</span> <span class="n">only</span> <span class="n">be</span> <span class="n">called</span> <span class="n">with</span> <span class="n">a</span>
       <span class="n">GET_ARGS</span><span class="o">*</span><span class="p">(</span><span class="mi">3</span><span class="n">f</span><span class="p">)</span> <span class="n">routine</span> <span class="k">if</span> <span class="n">the</span> <span class="n">SPECIFIED</span><span class="p">(</span><span class="mi">3</span><span class="n">f</span><span class="p">)</span> <span class="n">function</span> <span class="k">is</span> <span class="o">.</span><span class="n">TRUE</span><span class="o">.</span>
       <span class="k">for</span> <span class="n">that</span> <span class="n">name</span><span class="o">.</span>

       <span class="n">Note</span> <span class="n">that</span> <span class="n">allocatable</span> <span class="n">arrays</span> <span class="n">cannot</span> <span class="n">be</span> <span class="n">EQUIVALENCEd</span> <span class="ow">in</span> <span class="n">Fortran</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">short</span> <span class="n">keywords</span> <span class="n">cannot</span> <span class="n">be</span> <span class="n">combined</span> <span class="n">unless</span> <span class="n">they</span> <span class="n">were</span> <span class="n">defined</span>
       <span class="n">using</span> <span class="n">the</span> <span class="o">--</span><span class="n">LONGNAME</span><span class="p">:</span><span class="n">SHORTNAME</span> <span class="n">syntax</span><span class="o">.</span> <span class="n">Even</span> <span class="n">then</span> <span class="o">-</span><span class="n">a</span> <span class="o">-</span><span class="n">b</span> <span class="o">-</span><span class="n">c</span>
       <span class="k">is</span> <span class="n">required</span> <span class="ow">not</span> <span class="o">-</span><span class="n">abc</span> <span class="n">unless</span> <span class="n">all</span> <span class="n">the</span> <span class="n">keywords</span> <span class="n">are</span> <span class="n">logicals</span>
       <span class="p">(</span><span class="n">Boolean</span> <span class="n">keys</span><span class="p">)</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">shuffling</span> <span class="k">is</span> <span class="ow">not</span> <span class="n">supported</span><span class="o">.</span> <span class="n">Values</span> <span class="n">should</span> <span class="n">follow</span> <span class="n">their</span>
       <span class="n">keywords</span><span class="o">.</span>

     <span class="n">o</span> <span class="k">if</span> <span class="n">a</span> <span class="n">parameter</span> <span class="n">value</span> <span class="n">of</span> <span class="n">just</span> <span class="s2">&quot;-&quot;</span> <span class="k">is</span> <span class="n">supplied</span> <span class="n">it</span> <span class="k">is</span>
       <span class="n">converted</span> <span class="n">to</span> <span class="n">the</span> <span class="n">string</span> <span class="s2">&quot;stdin&quot;</span><span class="o">.</span>

     <span class="n">o</span> <span class="n">values</span> <span class="ow">not</span> <span class="n">matching</span> <span class="n">a</span> <span class="n">keyword</span> <span class="n">go</span> <span class="n">into</span> <span class="n">the</span> <span class="n">character</span>
       <span class="n">array</span> <span class="s2">&quot;UNUSED&quot;</span><span class="o">.</span>

     <span class="n">o</span> <span class="k">if</span> <span class="n">the</span> <span class="n">keyword</span> <span class="s2">&quot;--&quot;</span> <span class="k">is</span> <span class="n">encountered</span> <span class="n">the</span> <span class="n">rest</span> <span class="n">of</span> <span class="n">the</span>
       <span class="n">command</span> <span class="n">arguments</span> <span class="n">go</span> <span class="n">into</span> <span class="n">the</span> <span class="n">character</span> <span class="n">array</span> <span class="s2">&quot;UNUSED&quot;</span><span class="o">.</span>
</code></pre></div>

<h2 id="example">EXAMPLE</h2>
<p>Sample program:</p>
<div class="codehilite"><pre><span></span><code> <span class="nv">program</span> <span class="nv">demo_set_args</span>
 <span class="nv">use</span> <span class="nv">M_CLI2</span>,  <span class="nv">only</span> : <span class="nv">filenames</span><span class="o">=&gt;</span><span class="nv">unnamed</span>, <span class="nv">set_args</span>, <span class="nv">get_args</span>
 <span class="nv">use</span> <span class="nv">M_CLI2</span>,  <span class="nv">only</span> : <span class="nv">get_args_fixed_size</span>
 <span class="nv">implicit</span> <span class="nv">none</span>
 <span class="nv">integer</span>                      :: <span class="nv">i</span>
 <span class="o">!</span> <span class="nv">DEFINE</span> <span class="nv">ARGS</span>
 <span class="nv">real</span>                         :: <span class="nv">x</span>, <span class="nv">y</span>, <span class="nv">z</span>
 <span class="nv">real</span>                         :: <span class="nv">p</span><span class="ss">(</span><span class="mi">3</span><span class="ss">)</span>
 <span class="nv">character</span><span class="ss">(</span><span class="nv">len</span><span class="o">=</span>:<span class="ss">)</span>,<span class="nv">allocatable</span> :: <span class="nv">title</span>
 <span class="nv">logical</span>                      :: <span class="nv">l</span>, <span class="nv">lbig</span>
 <span class="nv">integer</span>,<span class="nv">allocatable</span>          :: <span class="nv">ints</span><span class="ss">(</span>:<span class="ss">)</span>
 <span class="o">!</span>
 <span class="o">!</span>  <span class="nv">DEFINE</span> <span class="nv">COMMAND</span> <span class="ss">(</span><span class="nv">TO</span> <span class="nv">SET</span> <span class="nv">INITIAL</span> <span class="nv">VALUES</span> <span class="nv">AND</span> <span class="nv">ALLOWED</span> <span class="nv">KEYWORDS</span><span class="ss">)</span>
 <span class="o">!</span>  <span class="nv">AND</span> <span class="nv">READ</span> <span class="nv">COMMAND</span> <span class="nv">LINE</span>
 <span class="k">call</span> <span class="nl">set_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s"> &amp;</span>
    <span class="o">!</span> <span class="nv">reals</span>
    <span class="o">&amp;</span> <span class="o">-</span><span class="nv">x</span> <span class="mi">1</span> <span class="o">-</span><span class="nv">y</span> <span class="mi">2</span>.<span class="mi">3</span> <span class="o">-</span><span class="nv">z</span> <span class="mi">3</span>.<span class="mi">4</span><span class="nv">e2</span> <span class="o">&amp;</span>
    <span class="o">!</span> <span class="nv">integer</span> <span class="nv">array</span>
    <span class="o">&amp;</span> <span class="o">-</span><span class="nv">p</span> <span class="o">-</span><span class="mi">1</span>,<span class="o">-</span><span class="mi">2</span>,<span class="o">-</span><span class="mi">3</span> <span class="o">&amp;</span>
    <span class="o">!</span> <span class="nv">always</span> <span class="nv">double</span><span class="o">-</span><span class="nv">quote</span> <span class="nv">strings</span>
    <span class="o">&amp;</span> <span class="o">--</span><span class="nv">title</span> <span class="s2">&quot;</span><span class="s">my title</span><span class="s2">&quot;</span> <span class="o">&amp;</span>
    <span class="o">!</span> <span class="nv">set</span> <span class="nv">all</span> <span class="nv">logical</span> <span class="nv">values</span> <span class="nv">to</span> <span class="nv">F</span> <span class="nv">or</span> <span class="nv">T</span>.
    <span class="o">&amp;</span> <span class="o">-</span><span class="nv">l</span> <span class="nv">F</span> <span class="o">-</span><span class="nv">L</span> <span class="nv">F</span> <span class="o">&amp;</span>
    <span class="o">!</span> <span class="nv">set</span> <span class="nv">allocatable</span> <span class="nv">size</span> <span class="nv">to</span> <span class="nv">zero</span> <span class="k">if</span> <span class="nv">you</span> <span class="nv">like</span> <span class="nv">by</span> <span class="nv">using</span> <span class="nv">a</span> <span class="nv">delimiter</span>
    <span class="o">&amp;</span> <span class="o">-</span><span class="nv">ints</span> , <span class="o">&amp;</span>
    <span class="o">!</span> <span class="nv">string</span> <span class="nv">should</span> <span class="nv">be</span> <span class="nv">a</span> <span class="nv">single</span> <span class="nv">character</span> <span class="nv">at</span> <span class="nv">a</span> <span class="nv">minimum</span>
    <span class="o">&amp;</span> <span class="o">--</span><span class="nv">label</span> <span class="s2">&quot;</span><span class="s"> </span><span class="s2">&quot;</span> <span class="o">&amp;</span>
    <span class="o">&amp;</span> <span class="s1">&#39;</span><span class="s">)</span>
 <span class="o">!</span> <span class="nv">ASSIGN</span> <span class="nv">VALUES</span> <span class="nv">TO</span> <span class="nv">ELEMENTS</span>
 <span class="o">!</span>     <span class="nv">SCALARS</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">x</span><span class="s1">&#39;</span>,<span class="nv">x</span><span class="ss">)</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">y</span><span class="s1">&#39;</span>,<span class="nv">y</span><span class="ss">)</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">z</span><span class="s1">&#39;</span>,<span class="nv">z</span><span class="ss">)</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">l</span><span class="s1">&#39;</span>,<span class="nv">l</span><span class="ss">)</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">L</span><span class="s1">&#39;</span>,<span class="nv">lbig</span><span class="ss">)</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">ints</span><span class="s1">&#39;</span>,<span class="nv">ints</span><span class="ss">)</span>      <span class="o">!</span> <span class="nv">ALLOCATABLE</span> <span class="nv">ARRAY</span>
 <span class="k">call</span> <span class="nl">get_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">title</span><span class="s1">&#39;</span>,<span class="nv">title</span><span class="ss">)</span>    <span class="o">!</span> <span class="nv">ALLOCATABLE</span> <span class="nv">STRING</span>
 <span class="k">call</span> <span class="nl">get_args_fixed_size</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">p</span><span class="s1">&#39;</span>,<span class="nv">p</span><span class="ss">)</span> <span class="o">!</span> <span class="nv">NON</span><span class="o">-</span><span class="nv">ALLOCATABLE</span> <span class="nv">ARRAY</span>
 <span class="o">!</span> <span class="nv">USE</span> <span class="nv">VALUES</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">x=</span><span class="s1">&#39;</span>,<span class="nv">x</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">y=</span><span class="s1">&#39;</span>,<span class="nv">y</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">z=</span><span class="s1">&#39;</span>,<span class="nv">z</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">p=</span><span class="s1">&#39;</span>,<span class="nv">p</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">title=</span><span class="s1">&#39;</span>,<span class="nv">title</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">ints=</span><span class="s1">&#39;</span>,<span class="nv">ints</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">l=</span><span class="s1">&#39;</span>,<span class="nv">l</span>
 <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="o">*</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">L=</span><span class="s1">&#39;</span>,<span class="nv">lbig</span>
 <span class="o">!</span> <span class="nv">UNNAMED</span> <span class="nv">VALUES</span>
 <span class="k">if</span><span class="ss">(</span><span class="nv">size</span><span class="ss">(</span><span class="nv">filenames</span><span class="ss">)</span>.<span class="nv">gt</span>.<span class="mi">0</span><span class="ss">)</span><span class="k">then</span>
    <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="s1">&#39;</span><span class="s">(i6.6,3a)</span><span class="s1">&#39;</span><span class="ss">)(</span><span class="nv">i</span>,<span class="s1">&#39;</span><span class="s">[</span><span class="s1">&#39;</span>,<span class="nv">filenames</span><span class="ss">(</span><span class="nv">i</span><span class="ss">)</span>,<span class="s1">&#39;</span><span class="s">]</span><span class="s1">&#39;</span>,<span class="nv">i</span><span class="o">=</span><span class="mi">1</span>,<span class="nv">size</span><span class="ss">(</span><span class="nv">filenames</span><span class="ss">))</span>
 <span class="k">endif</span>
 <span class="k">end</span> <span class="nv">program</span> <span class="nv">demo_set_args</span>
</code></pre></div>

<h2 id="response-files">RESPONSE FILES</h2>
<p>If you have no interest in using external files as abbreviations
  you can ignore this section. Otherwise, before calling set_args(3f)
  add:</p>
<div class="codehilite"><pre><span></span><code> use M_CLI2, only : CLI_response_file
 CLI_response_file=.true.
</code></pre></div>

<p>M_CLI2 Response files are small files containing CLI (Command Line
  Interface) arguments that end with &ldquo;.rsp&rdquo; that can be used when command
  lines are so long that they would exceed line length limits or so complex
  that it is useful to have a platform-independent method of creating
  an abbreviation.</p>
<p>Shell aliases and scripts are often used for similar purposes (and
  allow for much more complex conditional execution, of course), but
  they generally cannot be used to overcome line length limits and are
  typically platform-specific.</p>
<p>Examples of commands that support similar response files are the Clang
  and Intel compilers, although there is no standard format for the files.</p>
<p>They are read if you add options of the syntax &ldquo;@NAME&rdquo; as the FIRST
  parameters on your program command line calls. They are not recursive &ndash;
  that is, an option in a response file cannot be given the value &ldquo;@NAME2&rdquo;
  to call another response file.</p>
<p>Note that more than one response name may appear on a command line.</p>
<p>They are case-sensitive names.</p>
<p>LOCATING RESPONSE FILES</p>
<p>A search for the response file always starts with the current directory.
  The search then proceeds to look in any additional directories specified
  with the colon-delimited environment variable CLI_RESPONSE_PATH.</p>
<p>The first resource file found that results in lines being processed
  will be used and processing stops after that first match is found. If
  no match is found an error occurs and the program is stopped.</p>
<p>RESPONSE FILE SECTIONS</p>
<p>A simple response file just has options for calling the program in it
  prefixed with the word &ldquo;options&rdquo;.
  But they can also contain section headers to denote selections that are
  only executed when a specific OS is being used, print messages, and
  execute system commands.</p>
<p>SEARCHING FOR OSTYPE IN REGULAR FILES</p>
<p>So assuming the name @NAME was specified on the command line a file
  named NAME.rsp will be searched for in all the search directories
  and then in that file a string that starts with the string @OSTYPE
  (if the environment variables $OS and $OSTYPE are not blank. $OSTYPE
  takes precedence over $OS).</p>
<p>SEARCHING FOR UNLABELED DIRECTIVES IN REGULAR FILES</p>
<p>Then, the same files will be searched for lines above any line starting
  with &ldquo;@&rdquo;. That is, if there is no special section for the current OS
  it just looks at the top of the file for unlabeled options.</p>
<p>SEARCHING FOR OSTYPE AND NAME IN THE COMPOUND FILE</p>
<p>In addition or instead of files with the same name as the @NAME option
  on the command line, you can have one file named after the executable
  name that contains multiple abbreviation names.</p>
<p>So if your program executable is named EXEC you create a single file
  called EXEC.rsp and can append all the simple files described above
  separating them with lines of the form @OSTYPE@NAME or just @NAME.</p>
<p>So if no specific file for the abbreviation is found a file called
  &ldquo;EXEC.rsp&rdquo; is searched for where &ldquo;EXEC&rdquo; is the name of the executable.
  This file is always a &ldquo;compound&rdquo; response file that uses the following format:</p>
<p>Any compound EXEC.rsp file found in the current or searched directories
  will be searched for the string @OSTYPE@NAME first.</p>
<p>Then if nothing is found, the less specific line @NAME is searched for.</p>
<p>THE SEARCH IS OVER</p>
<p>Sounds complicated but actually works quite intuitively. Make a file in
  the current directory and put options in it and it will be used. If that
  file ends up needing different cases for different platforms add a line
  like &ldquo;@Linux&rdquo; to the file and some more lines and that will only be
  executed if the environment variable OSTYPE or OS is &ldquo;Linux&rdquo;. If no match
  is found for named sections the lines at the top before any &ldquo;@&rdquo; lines
  will be used as a default if no match is found.</p>
<p>If you end up using a lot of files like this you can combine them all
  together and put them into a file called &ldquo;program_name&rdquo;.rsp and just
  put lines like @NAME or @OSTYPE@NAME at that top of each selection.</p>
<p>Now, back to the details on just what you can put in the files.</p>
<h2 id="specification-for-response-files">SPECIFICATION FOR RESPONSE FILES</h2>
<p>SIMPLE RESPONSE FILES</p>
<p>The first word of a line is special and has the following meanings:</p>
<div class="codehilite"><pre><span></span><code><span class="n">options</span><span class="o">|-</span>  <span class="n">Command</span> <span class="n">options</span> <span class="n">following</span> <span class="n">the</span> <span class="n">rules</span> <span class="n">of</span> <span class="n">the</span> <span class="n">SET_ARGS</span><span class="p">(</span><span class="mi">3</span><span class="n">f</span><span class="p">)</span>
           <span class="n">prototype</span><span class="o">.</span> <span class="n">So</span>
            <span class="n">o</span> <span class="n">It</span> <span class="k">is</span> <span class="n">preferred</span> <span class="n">to</span> <span class="n">specify</span> <span class="n">a</span> <span class="n">value</span> <span class="k">for</span> <span class="n">all</span> <span class="n">options</span><span class="o">.</span>
            <span class="n">o</span> <span class="n">double</span><span class="o">-</span><span class="n">quote</span> <span class="n">strings</span><span class="o">.</span>
            <span class="n">o</span> <span class="n">give</span> <span class="n">a</span> <span class="n">blank</span> <span class="n">string</span> <span class="n">value</span> <span class="k">as</span> <span class="s2">&quot; &quot;</span><span class="o">.</span>
            <span class="n">o</span> <span class="n">use</span> <span class="n">F</span><span class="o">|</span><span class="n">T</span> <span class="k">for</span> <span class="n">lists</span> <span class="n">of</span> <span class="n">logicals</span><span class="p">,</span>
            <span class="n">o</span> <span class="n">lists</span> <span class="n">of</span> <span class="n">numbers</span> <span class="n">should</span> <span class="n">be</span> <span class="n">comma</span><span class="o">-</span><span class="n">delimited</span><span class="o">.</span>
<span class="n">comment</span><span class="o">|</span><span class="c1">#  Line is a comment line</span>
<span class="n">system</span><span class="o">|!</span>   <span class="n">System</span> <span class="n">command</span><span class="o">.</span>
           <span class="n">System</span> <span class="n">commands</span> <span class="n">are</span> <span class="n">executed</span> <span class="k">as</span> <span class="n">a</span> <span class="n">simple</span> <span class="n">call</span> <span class="n">to</span>
           <span class="n">system</span> <span class="p">(</span><span class="n">so</span> <span class="n">a</span> <span class="n">cd</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="ow">or</span> <span class="n">setting</span> <span class="n">a</span> <span class="n">shell</span> <span class="n">variable</span>
           <span class="n">would</span> <span class="ow">not</span> <span class="n">effect</span> <span class="n">subsequent</span> <span class="n">lines</span><span class="p">,</span> <span class="k">for</span> <span class="n">example</span><span class="p">)</span>
<span class="nb">print</span><span class="o">|&gt;</span>    <span class="n">Message</span> <span class="n">to</span> <span class="n">screen</span>
<span class="n">stop</span>       <span class="n">display</span> <span class="n">message</span> <span class="ow">and</span> <span class="n">stop</span> <span class="n">program</span><span class="o">.</span>
</code></pre></div>

<p>So if a program that does nothing but echos its parameters</p>
<div class="codehilite"><pre><span></span><code><span class="nv">program</span> <span class="nv">testit</span>
<span class="nv">use</span> <span class="nv">M_CLI2</span>, <span class="nv">only</span> : <span class="nv">set_args</span>, <span class="nv">rget</span>, <span class="nv">sget</span>, <span class="nv">lget</span>
<span class="nv">use</span> <span class="nv">M_CLI2</span>, <span class="nv">only</span> : <span class="nv">CLI_response_file</span>
<span class="nv">implicit</span> <span class="nv">none</span>
   <span class="nv">real</span> :: <span class="nv">x</span>,<span class="nv">y</span>                           <span class="c1">; namelist/args/ x,y</span>
   <span class="nv">character</span><span class="ss">(</span><span class="nv">len</span><span class="o">=</span>:<span class="ss">)</span>,<span class="nv">allocatable</span> :: <span class="nv">title</span> <span class="c1">; namelist/args/ title</span>
   <span class="nv">logical</span> :: <span class="nv">big</span>                        <span class="c1">; namelist/args/ big</span>
   <span class="nv">CLI_response_file</span><span class="o">=</span>.<span class="nv">true</span>.
   <span class="k">call</span> <span class="nl">set_args</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">-x 10.0 -y 20.0 --title &quot;my title&quot; --big F</span><span class="s1">&#39;</span><span class="ss">)</span>
   <span class="nv">x</span><span class="o">=</span><span class="nv">rget</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">x</span><span class="s1">&#39;</span><span class="ss">)</span>
   <span class="nv">y</span><span class="o">=</span><span class="nv">rget</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">y</span><span class="s1">&#39;</span><span class="ss">)</span>
   <span class="nv">title</span><span class="o">=</span><span class="nv">sget</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">title</span><span class="s1">&#39;</span><span class="ss">)</span>
   <span class="nv">big</span><span class="o">=</span><span class="nv">lget</span><span class="ss">(</span><span class="s1">&#39;</span><span class="s">big</span><span class="s1">&#39;</span><span class="ss">)</span>
   <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="nv">nml</span><span class="o">=</span><span class="nv">args</span><span class="ss">)</span>
<span class="k">end</span> <span class="nv">program</span> <span class="nv">testit</span>
</code></pre></div>

<p>And a file in the current directory called &ldquo;a.rsp&rdquo; contains</p>
<div class="codehilite"><pre><span></span><code> # <span class="nv">defaults</span> <span class="k">for</span> <span class="nv">project</span> <span class="nv">A</span>
 <span class="nv">options</span> <span class="o">-</span><span class="nv">x</span> <span class="mi">1000</span> <span class="o">-</span><span class="nv">y</span> <span class="mi">9999</span>
 <span class="nv">options</span> <span class="o">--</span><span class="nv">title</span> <span class="s2">&quot;</span><span class="s"> </span><span class="s2">&quot;</span>
 <span class="nv">options</span> <span class="o">--</span><span class="nv">big</span> <span class="nv">T</span>
</code></pre></div>

<p>The program could be called with</p>
<div class="codehilite"><pre><span></span><code><span class="w"> </span><span class="err">$</span><span class="n">myprog</span><span class="w">     </span><span class="err">#</span><span class="w"> </span><span class="n">normal</span><span class="w"> </span><span class="k">call</span><span class="w"></span>
<span class="w">  </span><span class="n">X</span><span class="o">=</span><span class="mf">10.0</span><span class="w"> </span><span class="n">Y</span><span class="o">=</span><span class="mf">20.0</span><span class="w"> </span><span class="n">TITLE</span><span class="o">=</span><span class="ss">&quot;my title&quot;</span><span class="w"></span>

<span class="w"> </span><span class="err">$</span><span class="n">myprog</span><span class="w"> </span><span class="nv">@a</span><span class="w">  </span><span class="err">#</span><span class="w"> </span><span class="n">change</span><span class="w"> </span><span class="n">defaults</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">specified</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="ss">&quot;a.rsp&quot;</span><span class="w"></span>
<span class="w"> </span><span class="n">X</span><span class="o">=</span><span class="mf">1000.0</span><span class="w"> </span><span class="n">Y</span><span class="o">=</span><span class="mf">9999.0</span><span class="w"> </span><span class="n">TITLE</span><span class="o">=</span><span class="ss">&quot; &quot;</span><span class="w"></span>

<span class="w"> </span><span class="err">#</span><span class="w"> </span><span class="n">change</span><span class="w"> </span><span class="n">defaults</span><span class="w"> </span><span class="n">but</span><span class="w"> </span><span class="k">use</span><span class="w"> </span><span class="ow">any</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">normal</span><span class="w"> </span><span class="k">to</span><span class="w"> </span><span class="n">override</span><span class="w"> </span><span class="n">defaults</span><span class="w"></span>
<span class="w"> </span><span class="err">$</span><span class="n">myprog</span><span class="w"> </span><span class="nv">@a</span><span class="w"> </span><span class="o">-</span><span class="n">y</span><span class="w"> </span><span class="mi">1234</span><span class="w"></span>
<span class="w">  </span><span class="n">X</span><span class="o">=</span><span class="mf">1000.0</span><span class="w"> </span><span class="n">Y</span><span class="o">=</span><span class="mf">1234.0</span><span class="w"> </span><span class="n">TITLE</span><span class="o">=</span><span class="ss">&quot; &quot;</span><span class="w"></span>
</code></pre></div>

<p>COMPOUND RESPONSE FILES</p>
<p>A compound response file has the same basename as the executable with a
  &ldquo;.rsp&rdquo; suffix added. So if your program is named &ldquo;myprg&rdquo; the filename
  must be &ldquo;myprg.rsp&rdquo;.</p>
<div class="codehilite"><pre><span></span><code><span class="n">Note</span> <span class="n">that</span> <span class="n">here</span> <span class="n n-Quoted">`basename`</span> <span class="n">means</span> <span class="n">the</span> <span class="k">last</span> <span class="n">leaf</span>  <span class="k">of</span> <span class="n">the</span>
<span class="k">name</span> <span class="k">of</span> <span class="n">the</span> <span class="n">program</span> <span class="k">as</span> <span class="n">returned</span> <span class="k">by</span> <span class="n">the</span> <span class="n">Fortran</span> <span class="n">intrinsic</span>
<span class="n">GET_COMMAND_ARGUMENT</span><span class="p">(</span><span class="mi">0</span><span class="p">,...)</span> <span class="n">trimmed</span> <span class="k">of</span> <span class="n">anything</span> <span class="k">after</span> <span class="n">a</span> <span class="n">period</span> <span class="p">(</span><span class="s2">&quot;.&quot;</span><span class="p">),</span>
<span class="n">so</span> <span class="n">it</span> <span class="k">is</span> <span class="n">a</span> <span class="n">good</span> <span class="n">idea</span> <span class="k">not</span> <span class="k">to</span> <span class="k">use</span> <span class="n">hidden</span> <span class="n">files</span><span class="p">.</span>
</code></pre></div>

<p>Unlike simple response files compound response files can contain multiple
  setting names.</p>
<p>Specifically in a compound file
  if the environment variable $OSTYPE (first) or $OS is set the first search
  will be for a line of the form (no leading spaces should be used):</p>
<div class="codehilite"><pre><span></span><code><span class="nv">@OSTYPE@alias_name</span><span class="w"></span>
</code></pre></div>

<p>If no match or if the environment variables $OSTYPE and $OS were not
  set or a match is not found then a line of the form</p>
<div class="codehilite"><pre><span></span><code><span class="nv">@alias_name</span><span class="w"></span>
</code></pre></div>

<p>is searched for in simple or compound files. If found subsequent lines
  will be ignored that start with &ldquo;@&rdquo; until a line not starting with
  &ldquo;@&rdquo; is encountered. Lines will then be processed until another line
  starting with &ldquo;@&rdquo; is found or end-of-file is encountered.</p>
<p>COMPOUND RESPONSE FILE EXAMPLE
  An example compound file</p>
<div class="codehilite"><pre><span></span><code>#################<span class="w"></span>
<span class="p">@</span><span class="k">if</span><span class="w"></span>
<span class="o">&gt;</span><span class="w"> </span><span class="n">RUNNING</span><span class="w"> </span><span class="n">TESTS</span><span class="w"> </span><span class="n">USING</span><span class="w"> </span><span class="n">RELEASE</span><span class="w"> </span><span class="n">VERSION</span><span class="w"> </span><span class="n">AND</span><span class="w"> </span><span class="n">ifort</span><span class="w"></span>
<span class="n">options</span><span class="w"> </span><span class="s">test</span><span class="w"> </span><span class="o">--</span><span class="nb">release</span><span class="w"> </span><span class="o">--</span><span class="n">compiler</span><span class="w"> </span><span class="n">ifort</span><span class="w"></span>
#################<span class="w"></span>
<span class="p">@</span><span class="n">gf</span><span class="w"></span>
<span class="o">&gt;</span><span class="w"> </span><span class="n">RUNNING</span><span class="w"> </span><span class="n">TESTS</span><span class="w"> </span><span class="n">USING</span><span class="w"> </span><span class="n">RELEASE</span><span class="w"> </span><span class="n">VERSION</span><span class="w"> </span><span class="n">AND</span><span class="w"> </span><span class="n">gfortran</span><span class="w"></span>
<span class="n">options</span><span class="w"> </span><span class="s">test</span><span class="w"> </span><span class="o">--</span><span class="nb">release</span><span class="w"> </span><span class="o">--</span><span class="n">compiler</span><span class="w"> </span><span class="n">gfortran</span><span class="w"></span>
#################<span class="w"></span>
<span class="p">@</span><span class="n">nv</span><span class="w"></span>
<span class="o">&gt;</span><span class="w"> </span><span class="n">RUNNING</span><span class="w"> </span><span class="n">TESTS</span><span class="w"> </span><span class="n">USING</span><span class="w"> </span><span class="n">RELEASE</span><span class="w"> </span><span class="n">VERSION</span><span class="w"> </span><span class="n">AND</span><span class="w"> </span><span class="n">nvfortran</span><span class="w"></span>
<span class="n">options</span><span class="w"> </span><span class="s">test</span><span class="w"> </span><span class="o">--</span><span class="nb">release</span><span class="w"> </span><span class="o">--</span><span class="n">compiler</span><span class="w"> </span><span class="n">nvfortran</span><span class="w"></span>
#################<span class="w"></span>
<span class="p">@</span><span class="n">nag</span><span class="w"></span>
<span class="o">&gt;</span><span class="w"> </span><span class="n">RUNNING</span><span class="w"> </span><span class="n">TESTS</span><span class="w"> </span><span class="n">USING</span><span class="w"> </span><span class="n">RELEASE</span><span class="w"> </span><span class="n">VERSION</span><span class="w"> </span><span class="n">AND</span><span class="w"> </span><span class="n">nagfor</span><span class="w"></span>
<span class="n">options</span><span class="w"> </span><span class="s">test</span><span class="w"> </span><span class="o">--</span><span class="nb">release</span><span class="w"> </span><span class="o">--</span><span class="n">compiler</span><span class="w"> </span><span class="n">nagfor</span><span class="w"></span>
#<span class="w"></span>
#################<span class="w"></span>
#<span class="w"> </span><span class="n">OS</span><span class="o">-</span><span class="n">specific</span><span class="w"> </span><span class="n">example</span><span class="p">:</span><span class="w"></span>
<span class="p">@</span><span class="n">Linux</span><span class="p">@</span><span class="n">install</span><span class="w"></span>
#<span class="w"></span>
#<span class="w"> </span><span class="n">install</span><span class="w"> </span><span class="n">executables</span><span class="w"> </span><span class="n">in</span><span class="w"> </span><span class="n">directory</span><span class="w"> </span><span class="p">(</span><span class="n">assuming</span><span class="w"> </span><span class="n">install</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="n">exists</span><span class="p">)</span><span class="w"></span>
#<span class="w"></span>
<span class="nb">system</span><span class="w"> </span><span class="nb">mkdir</span><span class="w"> </span><span class="o">-</span><span class="n">p</span><span class="w"> </span><span class="o">~/</span><span class="p">.</span><span class="n">local</span><span class="o">/</span><span class="n">bin</span><span class="w"></span>
<span class="n">options</span><span class="w"> </span><span class="s">run</span><span class="w"> </span><span class="o">--</span><span class="nb">release</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="o">--</span><span class="n">runner</span><span class="w"> </span><span class="s">&quot;install -vbp -m 0711 -t ~/.local/bin&quot;</span><span class="w"></span>
<span class="p">@</span><span class="n">install</span><span class="w"></span>
<span class="n">STOP</span><span class="w"> </span><span class="s">INSTALL</span><span class="w"> </span><span class="s">NOT</span><span class="w"> </span><span class="s">SUPPORTED</span><span class="w"> </span><span class="s">ON</span><span class="w"> </span><span class="s">THIS</span><span class="w"> </span><span class="s">PLATFORM</span><span class="w"> </span><span class="s">OR</span><span class="w"> </span><span class="s">$OSTYPE</span><span class="w"> </span><span class="s">NOT</span><span class="w"> </span><span class="s">SET</span><span class="w"></span>
#<span class="w"></span>
#################<span class="w"></span>
<span class="p">@</span><span class="n">fpm</span><span class="p">@</span><span class="n">testall</span><span class="w"></span>
#<span class="w"></span>
<span class="sx">!fpm test --compiler nvfortran</span><span class="w"></span>
<span class="sx">!fpm test --compiler ifort</span><span class="w"></span>
<span class="sx">!fpm test --compiler gfortran</span><span class="w"></span>
<span class="sx">!fpm test --compiler nagfor</span><span class="w"></span>
<span class="n">STOP</span><span class="w"> </span><span class="s">tests</span><span class="w"> </span><span class="s">complete.</span><span class="w"> </span><span class="s">Any</span><span class="w"> </span><span class="s">additional</span><span class="w"> </span><span class="s">parameters</span><span class="w"> </span><span class="s">were</span><span class="w"> </span><span class="s">ignored</span><span class="w"></span>
#################<span class="w"></span>
</code></pre></div>

<p>Would be used like</p>
<div class="codehilite"><pre><span></span><code><span class="n">fpm</span><span class="w"> </span><span class="nv">@install</span><span class="w"></span>
<span class="n">fpm</span><span class="w"> </span><span class="nv">@nag</span><span class="w"> </span><span class="o">--</span><span class="w"></span>
<span class="n">fpm</span><span class="w"> </span><span class="nv">@testall</span><span class="w"></span>
</code></pre></div>

<p>NOTES</p>
<div class="codehilite"><pre><span></span><code><span class="n">The</span><span class="w"> </span><span class="n">intel</span><span class="w"> </span><span class="k">Fortran</span><span class="w"> </span><span class="n">compiler</span><span class="w"> </span><span class="n">now</span><span class="w"> </span><span class="n">calls</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">response</span><span class="w"> </span><span class="n">files</span><span class="w"> </span><span class="ss">&quot;indirect</span>
<span class="ss">files&quot;</span><span class="w"> </span><span class="ow">and</span><span class="w"> </span><span class="n">does</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="k">add</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">implied</span><span class="w"> </span><span class="n">suffix</span><span class="w"> </span><span class="ss">&quot;.rsp&quot;</span><span class="w"> </span><span class="k">to</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">files</span><span class="w"></span>
<span class="n">anymore</span><span class="p">.</span><span class="w"> </span><span class="n">It</span><span class="w"> </span><span class="n">also</span><span class="w"> </span><span class="n">allows</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="nv">@NAME</span><span class="w"> </span><span class="n">syntax</span><span class="w"> </span><span class="n">anywhere</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">command</span><span class="w"></span>
<span class="n">line</span><span class="p">,</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">just</span><span class="w"> </span><span class="k">at</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">beginning</span><span class="p">.</span><span class="w"> </span><span class="c1">--  20201212</span>
</code></pre></div>

<h2 id="author">AUTHOR</h2>
<div class="codehilite"><pre><span></span><code>  John S. Urban, 2019
</code></pre></div>

<h2 id="license">LICENSE</h2>
<div class="codehilite"><pre><span></span><code>  Public Domain
</code></pre></div>
    

    <h3>Arguments</h3>
    
      
<table class="table table-striped varlist">
<thead><tr><th>Type</th>
<th>Intent</th><th>Optional</th>
<th>Attributes</th><th></th><th>Name</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-prototype~2"></span>character(len=*),</td>
  <td>intent(in)</td>
  <td></td>
  
  <td></td><td>::</td>
  <td><strong>prototype</strong></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-help_text"></span>character(len=*),</td>
  <td>intent(in),</td>
  <td>optional</td>
  
  <td></td><td>::</td>
  <td><strong>help_text</strong>(:)</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-version_text"></span>character(len=*),</td>
  <td>intent(in),</td>
  <td>optional</td>
  
  <td></td><td>::</td>
  <td><strong>version_text</strong>(:)</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-string"></span>character(len=*),</td>
  <td>intent(in),</td>
  <td>optional</td>
  
  <td></td><td>::</td>
  <td><strong>string</strong></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-ierr"></span>integer,</td>
  <td>intent(out),</td>
  <td>optional</td>
  
  <td></td><td>::</td>
  <td><strong>ierr</strong></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-errmsg"></span>character(len=:),</td>
  <td>intent(out),</td>
  <td>optional</td>
  
  <td>allocatable</td><td>::</td>
  <td><strong>errmsg</strong></td><td></td>
  
</tr>

</tbody>
</table>

    
    
    
    
     
    <br>

    <section class="visible-xs visible-sm hidden-md">
      
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-1">Variables</a></h3></div>
  <div id="vars-1" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../proc/set_args.html#variable-hold">hold</a>
      
      <a class="list-group-item" href="../proc/set_args.html#variable-ibig">ibig</a>
      
    </div>
  </div>
</div>




















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../proc/set_args.html#src">set_args</a>
  </div>
</div>



    </section>
    <br class="visible-xs visible-sm hidden-md">

    

    
    <section>    
      <h2>Variables</h2>
    
<table class="table table-striped varlist">
<thead><tr><th>Type</th><th>Visibility</th>

<th>Attributes</th><th></th><th>Name</th><th></th><th>Initial</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-hold"></span>character(len=:),</td>
  
  <td>public,</td>
  <td>allocatable</td><td>::</td>
  <td><strong>hold</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-ibig"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>ibig</strong></td><td></td><td></td><td></td>
  
</tr>

</tbody>
</table>

    </section>
    <br>
    
    
    
    
    

    
    
    
    
    


    
    
    
    <section>
    <h2><span class="anchor" id="src"></span>Source Code</h2>
    <div class="highlight"><pre><span></span><span class="k">subroutine </span><span class="n">set_args</span><span class="p">(</span><span class="n">prototype</span><span class="p">,</span><span class="n">help_text</span><span class="p">,</span><span class="n">version_text</span><span class="p">,</span><span class="n">string</span><span class="p">,</span><span class="n">ierr</span><span class="p">,</span><span class="n">errmsg</span><span class="p">)</span>

<span class="c">! ident_2=&quot;@(#)M_CLI2::set_args(3f): parse prototype string&quot;</span>

<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>                       <span class="kd">::</span> <span class="n">prototype</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span>              <span class="kd">::</span> <span class="n">help_text</span><span class="p">(:)</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span>              <span class="kd">::</span> <span class="n">version_text</span><span class="p">(:)</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span>              <span class="kd">::</span> <span class="n">string</span>
<span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">out</span><span class="p">),</span><span class="k">optional</span>                      <span class="kd">::</span> <span class="n">ierr</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="k">intent</span><span class="p">(</span><span class="n">out</span><span class="p">),</span><span class="k">allocatable</span><span class="p">,</span><span class="k">optional</span> <span class="kd">::</span> <span class="n">errmsg</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="k">allocatable</span>                      <span class="kd">::</span> <span class="n">hold</span>               <span class="c">! stores command line argument</span>
<span class="kt">integer</span>                                           <span class="kd">::</span> <span class="n">ibig</span>
   <span class="n">G_response</span><span class="o">=</span><span class="n">CLI_RESPONSE_FILE</span>
   <span class="n">G_options_only</span><span class="o">=</span><span class="p">.</span><span class="n">false</span><span class="p">.</span>
   <span class="n">G_append</span><span class="o">=</span><span class="p">.</span><span class="n">true</span><span class="p">.</span>
   <span class="n">G_passed_in</span><span class="o">=</span><span class="s1">&#39;&#39;</span>
   <span class="n">G_STOP</span><span class="o">=</span><span class="mi">0</span>
   <span class="n">G_STOP_MESSAGE</span><span class="o">=</span><span class="s1">&#39;&#39;</span>
   <span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">ierr</span><span class="p">))</span><span class="k">then</span>
<span class="k">      </span><span class="n">G_QUIET</span><span class="o">=</span><span class="p">.</span><span class="n">true</span><span class="p">.</span>
   <span class="k">else</span>
<span class="k">      </span><span class="n">G_QUIET</span><span class="o">=</span><span class="p">.</span><span class="n">false</span><span class="p">.</span>
   <span class="k">endif</span>
<span class="k">   </span><span class="n">ibig</span><span class="o">=</span><span class="n">longest_command_argument</span><span class="p">()</span> <span class="c">! bug in gfortran. len=0 should be fine</span>
   <span class="k">if</span><span class="p">(</span><span class="nb">allocated</span><span class="p">(</span><span class="n">unnamed</span><span class="p">))</span> <span class="k">deallocate</span><span class="p">(</span><span class="n">unnamed</span><span class="p">)</span>
   <span class="k">allocate</span><span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="n">ibig</span><span class="p">)</span> <span class="kd">::</span> <span class="n">unnamed</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
   <span class="k">if</span><span class="p">(</span><span class="nb">allocated</span><span class="p">(</span><span class="n">args</span><span class="p">))</span> <span class="k">deallocate</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
   <span class="k">allocate</span><span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="n">ibig</span><span class="p">)</span> <span class="kd">::</span> <span class="n">args</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>

   <span class="k">call </span><span class="n">wipe_dictionary</span><span class="p">()</span>
   <span class="n">hold</span><span class="o">=</span><span class="s1">&#39;--version F --usage F --help F --version F &#39;</span><span class="o">//</span><span class="nb">adjustl</span><span class="p">(</span><span class="n">prototype</span><span class="p">)</span>
   <span class="k">call </span><span class="n">prototype_and_cmd_args_to_nlist</span><span class="p">(</span><span class="n">hold</span><span class="p">,</span><span class="n">string</span><span class="p">)</span>
   <span class="k">if</span><span class="p">(</span><span class="nb">allocated</span><span class="p">(</span><span class="n">G_RESPONSE_IGNORED</span><span class="p">))</span><span class="k">then</span>
<span class="k">      if</span><span class="p">(</span><span class="n">debug_m_cli2</span><span class="p">)</span><span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="n">gen</span><span class="p">)</span><span class="s1">&#39;&lt;DEBUG&gt;SET_ARGS:G_RESPONSE_IGNORED:&#39;</span><span class="p">,</span><span class="n">G_RESPONSE_IGNORED</span>
      <span class="k">if</span><span class="p">(</span><span class="n">size</span><span class="p">(</span><span class="n">unnamed</span><span class="p">).</span><span class="n">ne</span><span class="p">.</span><span class="mi">0</span><span class="p">)</span><span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;LOGIC ERROR&#39;</span>
      <span class="k">call </span><span class="n">split</span><span class="p">(</span><span class="n">G_RESPONSE_IGNORED</span><span class="p">,</span><span class="n">unnamed</span><span class="p">)</span>
   <span class="k">endif</span>

<span class="k">   if</span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="nb">allocated</span><span class="p">(</span><span class="n">unnamed</span><span class="p">))</span><span class="k">then</span>
<span class="k">       allocate</span><span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="kd">::</span> <span class="n">unnamed</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
   <span class="k">endif</span>
<span class="k">   if</span><span class="p">(.</span><span class="nb">not</span><span class="p">.</span><span class="nb">allocated</span><span class="p">(</span><span class="n">args</span><span class="p">))</span><span class="k">then</span>
<span class="k">       allocate</span><span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="kd">::</span> <span class="n">args</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
   <span class="k">endif</span>
<span class="k">   call </span><span class="n">check_commandline</span><span class="p">(</span><span class="n">help_text</span><span class="p">,</span><span class="n">version_text</span><span class="p">)</span> <span class="c">! process --help, --version, --usage</span>
   <span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">ierr</span><span class="p">))</span><span class="k">then</span>
<span class="k">      </span><span class="n">ierr</span><span class="o">=</span><span class="n">G_STOP</span>
   <span class="k">endif</span>
<span class="k">   if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">errmsg</span><span class="p">))</span><span class="k">then</span>
<span class="k">      </span><span class="n">errmsg</span><span class="o">=</span><span class="n">G_STOP_MESSAGE</span>
   <span class="k">endif</span>
<span class="k">end subroutine </span><span class="n">set_args</span>
</pre></div>

    </section>
    <br>
    
    
    </div>
  </div>


    <hr>    
    </div> <!-- /container -->
    <footer>
      <div class="container">
      <div class="row">
        <div class="col-xs-6 col-md-4"><p>&copy; 2022 
                                          </p></div>
        <div class="col-xs-6 col-md-4 col-md-push-4">
          <p class="text-right">
            Documentation generated by 
            <a href="https://github.com/cmacmackin/ford">FORD</a>
             on 2022-06-08 21:13  
          </p>
        </div>
        <div class="col-xs-12 col-md-4 col-md-pull-4"><p class="text-center"> M_CLI2 was developed by John S. Urban</p></div>
      </div>
      <br>
      </div> <!-- /container -->    
    </footer>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
    <script src="../js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../js/ie10-viewport-bug-workaround.js"></script>

    <!-- MathJax JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
        jax: ['input/TeX','input/MathML','output/HTML-CSS'],
        extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
      });
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    
    <script src="../tipuesearch/tipuesearch_content.js"></script>
    <script src="../tipuesearch/tipuesearch_set.js"></script>
    <script src="../tipuesearch/tipuesearch.js"></script>
    
    
  </body>
</html>